﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace Zatify.WebUI.Admin.Models
{
    public class AddNewSystemUserViewModel
    {
        [Required(ErrorMessage = "User ID required")]
        [Remote("UserIDUnique", "SystemUsers", ErrorMessage="User ID must be unique.")]
        public string UserID { get; set; }

        [Required(ErrorMessage = "Password required")]
        public string Password { get; set; }

        [Required(ErrorMessage = "Confirm Password required")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessage = "Please enter a valid e-mail adress")]
        //[Required(ErrorMessage = "Email required")]
        public string Email { get; set; }

        //[Required(ErrorMessage = "Phone required")]
        public string Phone { get; set; }

        [Required(ErrorMessage = "Role required")]
        public string Role { get; set; }
    }
}